package com.jack90john;

import java.util.Map;

/**
 * Description:
 * Designer: jack
 * Date: 2018/4/4
 * Version: 1.0.0
 */
public class SecondTactics implements Command {

    private Map<Class<? extends Action>, Action> playerMap;

    public SecondTactics(Map<Class<? extends Action>, Action> playerMap) {
        this.playerMap = playerMap;
        System.out.println("开始执行第二套作战方案！");
    }


    @Override
    public void executed() {
        Action player1 = playerMap.get(Player1.class);
        Action player2 = playerMap.get(Player2.class);
        Action player3 = playerMap.get(Player2.class);
        player1.attack();
        player2.defend();
        player3.relax();
    }
}
